package com.renjun.smweb.service.RegisterService.impl;

import com.renjun.smweb.commons.componet.FileIOComponent;
import com.renjun.smweb.commons.enums.EStandTables;
import com.renjun.smweb.commons.global.DataDict;
import com.renjun.smweb.commons.global.FileInfoPo;
import com.renjun.smweb.commons.global.StaticCaches;
import com.renjun.smweb.commons.util.BaseChecks;
import com.renjun.smweb.exceptions.BaseException;
import com.renjun.smweb.exceptions.DictIsNotFoundException;
import com.renjun.smweb.exceptions.FileTypeNotFoundException;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.renjun.smweb.commons.componet.FileIOComponent;
import com.renjun.smweb.commons.enums.EStandTables;
import com.renjun.smweb.commons.global.DataDict;
import com.renjun.smweb.commons.global.FileInfoPo;
import com.renjun.smweb.commons.global.StaticCaches;
import com.renjun.smweb.commons.util.BaseChecks;
import com.renjun.smweb.exceptions.BaseException;
import com.renjun.smweb.exceptions.DictIsNotFoundException;
import com.renjun.smweb.exceptions.FileTypeNotFoundException;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Created by lrs on 2017/4/11.
 */
public class GenerateRegistrationFormHk {

    private static final String fontType = "simsun.ttc,0";  //字体类型

    private static final String fontPath = StaticCaches.getRealRootPath() + File.separator + "pdf_res" + File.separator + "fonts" + File.separator + fontType;  //字体路径

    private static final String imagePath = StaticCaches.getRealRootPath() + File.separator + "pdf_res" + File.separator + "image" + File.separator + "gou1.jpg";//图片路径

    //初始化BaseFont对象
    private BaseFont baseFont = BaseFont.createFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

    //字体大小
    private final Font font1 = new Font(baseFont, 15, Font.BOLD);    //标题字体
    private final Font font3 = new Font(baseFont, 9, Font.BOLD);   //页眉 (标准大小 + 粗体)
    private final Font font5 = new Font(baseFont, 8, Font.NORMAL);    //表格内容
    private final Font font6 = new Font(baseFont, 8, Font.NORMAL);    //表格内容
//    private final Font font6 = new Font(baseFont, 8, Font.NORMAL, new BaseColor(91, 155, 213));    //表格内容 （带颜色）

    private GenerateRegistrationFormHk() throws IOException, DocumentException {
    }

    //供外部调用的方法
    public static String createRegistrationFormHk(List<Map<String, Object>> params) throws DocumentException, BaseException, IOException {
        GenerateRegistrationFormHk g = new GenerateRegistrationFormHk();
        return g.generateRegistrationForm(params);
    }

    /**
     * 生成学生登记表
     *
     * @param data List<Map>
     * @return 下载地址(相对路径)
     * @throws FileTypeNotFoundException
     * @throws IOException
     * @throws DocumentException
     * @author lrs
     */
    private String generateRegistrationForm(List<Map<String, Object>> data) throws BaseException, IOException, DocumentException {
        //生成临时pdf文件，用以获取配置中的文件路径
        FileInfoPo fileInfoPo = FileIOComponent.createTempFilePathByType(FileIOComponent.EXPORT_TYPE, "pdf", "虹口区幼儿园报名（登记）表");
//        String tempPath = "D:\\123.pdf";
        String tempPath = fileInfoPo.getFileAbsPath();
        FileOutputStream fos = null;
        try {
            //初始文件输出流
            fos = new FileOutputStream(new File(tempPath));
            //初始化document对象
            Document document = new Document();
            //初始化pdfWriter对象
            PdfWriter pdfWriter = PdfWriter.getInstance(document, fos);
            //持久化pdfWriter对象
            pdfWriter.setCloseStream(false);
            //持久化document对象
            document.open();
            //往document对象添加数据
            addfoot(document, data);
            //关流
            document.close();
            pdfWriter.flush();
            pdfWriter.close();
        } catch (Exception e) {
            e.printStackTrace();
            throw new BaseException("生成学生登记表失败");
        } finally {
            if (fos != null) {
                fos.flush();
                fos.close();
            }
        }
        return fileInfoPo.getFileVirPath();
    }

    //添加页眉,页脚
    private void addfoot(Document document, List<Map<String, Object>> data) throws IOException, DocumentException, DictIsNotFoundException {
        for (Map<String, Object> map : data) {
//            PdfPTable rect = new PdfPTable(1);
//            rect.setWidthPercentage(15f);
//            rect.setWidths(new int[]{100});
//            rect.setHorizontalAlignment(0);
//
//            PdfPCell rectCell = new PdfPCell(new Paragraph("编号：", new Font(baseFont, 10, Font.NORMAL)));
//            rectCell.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
//            rectCell.setVerticalAlignment(Element.ALIGN_BOTTOM); //垂直对其方式
//            rectCell.setFixedHeight(33);
//            rectCell.setPadding(7);
//            rect.addCell(rectCell);
//            document.add(rect);

            Paragraph par = new Paragraph("虹口区幼儿园报名（登记）表\n\n", font1);
            par.setAlignment(1);                                //0:左对齐,1:中间,2,右边
            par.setSpacingBefore(10);
            document.add(par);

            String schoolname = (String) map.get("schoolname");
            schoolname = schoolname == null ? "" : schoolname;
            Paragraph par2 = new Paragraph("园所名称（盖章）：" + schoolname + "  幼儿园", font3);
            par2.setAlignment(0);                                //0:左对齐,1:中间,2,右边
            par2.setIndentationLeft(20);
            document.add(par2);

            String addtime = (String) map.get("addtime");
            addtime = addtime == null ? "" : addtime.replace("-", "");
            String year = "", month = "", day = "";
            if (!BaseChecks.hasEmptyStr(addtime) && addtime.length() >= 8) {
                year = addtime.substring(0, 4);
                month = addtime.substring(4, 6);
                day = addtime.substring(6, 8);
            }
            Paragraph par3 = new Paragraph("时间：" + year + "年" + month + "月" + day + "日", font3);
            par3.setSpacingBefore(-12);
            par3.setAlignment(2);                                //0:左对齐,1:中间,2,右边
            par3.setIndentationRight(60);
            document.add(par3);

            //添加表格
            addTable(document, map);

            Paragraph par5 = new Paragraph("备注：港澳台和外籍户籍与街道居委与户口性质都不填。\n", font5);
            par5.setAlignment(0);                                //0:左对齐,1:中间,2,右边
            par5.setSpacingBefore(3);
            document.add(par5);

//            Paragraph par6 = new Paragraph("经办教师：\n", font3);
//            par6.setAlignment(2);                                //0:左对齐,1:中间,2,右边
//            par6.setIndentationRight(60);
//            document.add(par6);
            //换页
            document.newPage();
        }
    }

    //添加表格
    private void addTable(Document document, Map<String, Object> params) throws DocumentException, DictIsNotFoundException {
        //基本信息表格
        PdfPTable table = new PdfPTable(6);
        table.setWidthPercentage(100f);
        table.setSpacingBefore(5f);
        table.setWidths(new float[]{3, 12, 15, 12, 29, 29});

        PdfPCell cell1 = new PdfPCell(new Paragraph("基\n\n本\n\n信\n\n息", font3));
        cell1.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell1.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell1.setFixedHeight(96);
        cell1.setRowspan(5);
        table.addCell(cell1);

        PdfPCell cell2 = new PdfPCell(new Paragraph("幼儿姓名", font6));
        cell2.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell2.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell2.setRowspan(2);
        cell2.setFixedHeight(28);
        table.addCell(cell2);

        String xm = (String) params.get("xm");
        xm = xm == null ? "" : xm;
        PdfPCell cell3 = new PdfPCell(new Paragraph(xm, font6));
        cell3.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell3.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell3.setRowspan(2);
        cell3.setFixedHeight(28);
        table.addCell(cell3);

        String sfzlx = (String) params.get("sfzlx");
        PdfPCell cell4 = new PdfPCell(new Paragraph(getSfzlxPdf(sfzlx), font6));
//        PdfPCell cell4 = new PdfPCell(new Paragraph("   □居民身份证 □港澳居民来往内地通行证 \n\n" +
//                "   □台湾居民来往大陆通行证  □境外  □护照", font6));
        cell4.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell4.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell4.setRowspan(2);
        cell4.setColspan(2);
        cell4.setFixedHeight(28);
        table.addCell(cell4);

        PdfPCell cell5 = new PdfPCell(new Paragraph("身份证件号", font6));
        cell5.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell5.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell5.setFixedHeight(14);
        table.addCell(cell5);

        String sfzjh = (String) params.get("sfzjh");
        sfzjh = sfzjh == null ? "" : sfzjh;
        PdfPCell cell6 = new PdfPCell(new Paragraph(sfzjh, font6));
        cell6.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell6.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell6.setFixedHeight(14);
        table.addCell(cell6);

        PdfPCell cell7 = new PdfPCell(new Paragraph("性    别", font6));
        cell7.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell7.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell7.setFixedHeight(20);
        table.addCell(cell7);

        String xb = (String) params.get("xb");
        xb = xb == null ? "" : DataDict.getChineseValueByCode(EStandTables.性别表, xb);
        PdfPCell cell8 = new PdfPCell(new Paragraph(xb, font6));
        cell8.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell8.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell8.setFixedHeight(20);
        table.addCell(cell8);

        PdfPCell cell9 = new PdfPCell(new Paragraph("出 生 日 期", font6));
        cell9.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell9.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell9.setFixedHeight(20);
        table.addCell(cell9);

        String csrq = (String) params.get("csrq");
        csrq = csrq == null ? "" : csrq.replace("-", "");
        String year = "", month = "", day = "";
        if (!BaseChecks.hasEmptyStr(csrq) && csrq.length() >= 8) {
            year = csrq.substring(0, 4);
            month = csrq.substring(4, 6);
            day = csrq.substring(6, 8);
        }
        PdfPCell cell10 = new PdfPCell(new Paragraph("       " + year + "年   " + month + "月   " + day + "日 ", font6));
        cell10.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell10.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell10.setFixedHeight(20);
        table.addCell(cell10);

        String gjdq = (String) params.get("gjdq");
        gjdq = gjdq == null ? "" : DataDict.getChineseValueByCode(EStandTables.国籍地区表, gjdq);
        PdfPCell cell10_1 = new PdfPCell(new Paragraph("国籍：" + gjdq, font6));
        cell10_1.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell10_1.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell10_1.setFixedHeight(20);
        table.addCell(cell10_1);

        PdfPCell cell11 = new PdfPCell(new Paragraph("民    族", font6));
        cell11.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell11.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell11.setFixedHeight(20);
        table.addCell(cell11);

        String mz = (String) params.get("mz");
        mz = mz == null ? "" : DataDict.getChineseValueByCode(EStandTables.民族表, mz);
        PdfPCell cell12 = new PdfPCell(new Paragraph(mz, font6));
        cell12.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell12.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell12.setFixedHeight(20);
        table.addCell(cell12);

        PdfPCell cell13 = new PdfPCell(new Paragraph("是否独生子女", font6));
        cell13.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell13.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell13.setFixedHeight(20);
        table.addCell(cell13);

        String sfdszv = (String) params.get("sfdszv");
        PdfPCell cell14 = new PdfPCell(new Paragraph(getSfdszvPdf(sfdszv), font6));
//        PdfPCell cell14 = new PdfPCell(new Paragraph("□ 独生子女 □ 双胞胎 □ 两胎及以上", font6));
        cell14.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell14.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell14.setColspan(2);
        cell14.setFixedHeight(20);
        table.addCell(cell14);

        PdfPCell cell15 = new PdfPCell(new Paragraph("健康状况", font6));
        cell15.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell15.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell15.setFixedHeight(24);
        table.addCell(cell15);

        String jkzk = (String) params.get("jkzk");
        PdfPCell cell16 = new PdfPCell(new Paragraph(getJkzkPdf(jkzk), font6));
//        PdfPCell cell16 = new PdfPCell(new Paragraph("  □健康或良好  □一般或较弱 \n\n" +
//                "   □有慢性病    □残疾", font6));
        cell16.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell16.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell16.setColspan(2);
        cell16.setFixedHeight(28);
        table.addCell(cell16);

        PdfPCell cell17 = new PdfPCell(new Paragraph("曾患何种慢性病遗传病\n" +
                "（如心脏病、哮喘等）", font6));
        cell17.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell17.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell17.setFixedHeight(28);
        table.addCell(cell17);

        String jbzk = (String) params.get("jbzk");
        jbzk = jbzk == null ? "" : jbzk;
        PdfPCell cell18 = new PdfPCell(new Paragraph(jbzk, font6));
        cell18.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell18.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell18.setFixedHeight(28);
        table.addCell(cell18);

        document.add(table);

        //户口所在地信息表格
        PdfPTable table2 = new PdfPTable(7);
        table2.setWidthPercentage(100f);
        table2.setWidths(new int[]{3, 12, 13, 12, 18, 15, 27});

        PdfPCell cell19 = new PdfPCell(new Paragraph("户\n口\n所\n在\n地", font3));
        cell19.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell19.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell19.setRowspan(3);
        cell19.setFixedHeight(68);
        table2.addCell(cell19);

        String hksf = (String) params.get("hksf");
        hksf = hksf == null ? "" : hksf;
        String hkdz = "";
        String wsshkdz = (String) params.get("wsshkdz");
        wsshkdz = wsshkdz == null ? "" : wsshkdz;
        if ("310000".equals(hksf)) {
            hksf = DataDict.getChineseValueByCode(EStandTables.省份城市表, hksf);
            String hkcity = (String) params.get("hkcity");  //户口市
            hkcity = hkcity == null ? "" : DataDict.getChineseValueByCode(EStandTables.省份城市表, hksf);
            String hkqx = (String) params.get("hkqx");  //户口区县
            hkqx = hkqx == null ? "" : DataDict.getChineseValueByCode(EStandTables.区县表, hkqx);
            String hkjz = (String) params.get("hkjz");  //户口街镇
            hkjz = hkjz == null ? "" : DataDict.getChineseValueByCode(EStandTables.街道表, hkjz);
            String hkjwh = (String) params.get("hkjwh");//户口居委
            hkjwh = hkjwh == null ? "" : DataDict.getChineseValueByCode(EStandTables.居委表, hkjwh);
            String hkrod = (String) params.get("hkrod");    //户口路
            hkrod = hkrod == null ? "" : hkrod + "路 ";
            String hkz = (String) params.get("hkz");        //户口弄
            hkz = hkz == null ? "" : hkz + "组/弄 ";
            String hkldh = (String) params.get("hkldh");    //户口楼栋号
            hkldh = hkldh == null ? "" : hkldh + "楼栋号 ";
            String hks = (String) params.get("hks");        //户口室
            hks = hks == null ? "" : hks + "室 ";
            hkdz = hksf + " " + hkcity + " " + hkqx + " " + hkjz + " " + hkjwh + " " + hkrod + hkz + hkldh + hks;
//            hkdz = hksf + "(省/市) " + hkqx + "(市/区县) " + hkjz + "(街镇) " + hkjwh + "(居委) " + hkrod + "(路) " + hkz + "(组/弄) " + hkldh + "(楼栋号) " + hks + "(室)";
        } else {
            hkdz = wsshkdz;
        }
        PdfPCell cell20 = new PdfPCell(new Paragraph("户口所在地地址：" + hkdz, font6));
        cell20.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell20.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell20.setColspan(6);
        cell20.setFixedHeight(20);
        table2.addCell(cell20);

        PdfPCell cell21 = new PdfPCell(new Paragraph("省   份", font6));
        cell21.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell21.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell21.setFixedHeight(20);
        table2.addCell(cell21);

        String hksf1 = (String) params.get("hksf");
        hksf1 = hksf1 == null ? "" : DataDict.getChineseValueByCode(EStandTables.省份城市表, hksf1);
        PdfPCell cell22 = new PdfPCell(new Paragraph(hksf1, font6));
        cell22.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell22.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell22.setFixedHeight(20);
        table2.addCell(cell22);

        PdfPCell cell23 = new PdfPCell(new Paragraph("城  市", font6));
        cell23.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell23.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell23.setFixedHeight(20);
        table2.addCell(cell23);

        String hkcity = (String) params.get("hkcity");
        hkcity = hkcity == null ? "" : DataDict.getChineseValueByCode(EStandTables.省份城市表, hkcity);
        PdfPCell cell24 = new PdfPCell(new Paragraph(hkcity, font6));
        cell24.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell24.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell24.setFixedHeight(20);
        table2.addCell(cell24);

        PdfPCell cell25 = new PdfPCell(new Paragraph("地   区", font6));
        cell25.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell25.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell25.setFixedHeight(20);
        table2.addCell(cell25);

        String hkqx = (String) params.get("hkqx");
        hkqx = hkqx == null ? "" : DataDict.getChineseValueByCode(EStandTables.省份城市表, hkqx);
        PdfPCell cell26 = new PdfPCell(new Paragraph(hkqx, font6));
        cell26.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell26.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell26.setFixedHeight(20);
        table2.addCell(cell26);

        PdfPCell cell27 = new PdfPCell(new Paragraph("街  道", font6));
        cell27.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell27.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell27.setFixedHeight(28);
        table2.addCell(cell27);

        String hkjz = (String) params.get("hkjz");
        hkjz = hkjz == null ? "" : DataDict.getChineseValueByCode(EStandTables.街道表, hkjz);
        PdfPCell cell28 = new PdfPCell(new Paragraph(hkjz, font6));
        cell28.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell28.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell28.setFixedHeight(28);
        table2.addCell(cell28);

        PdfPCell cell29 = new PdfPCell(new Paragraph("居  委", font6));
        cell29.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell29.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell29.setFixedHeight(28);
        table2.addCell(cell29);

        String hkjwh = (String) params.get("hkjwh");
        hkjwh = hkjwh == null ? "" : DataDict.getChineseValueByCode(EStandTables.居委表, hkjwh);
        PdfPCell cell30 = new PdfPCell(new Paragraph(hkjwh, font6));
        cell30.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell30.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell30.setFixedHeight(28);
        table2.addCell(cell30);

        String hkxz = (String) params.get("hkxz");
        PdfPCell cell31 = new PdfPCell(new Paragraph(getHkxzPdf(hkxz), font6));
//        PdfPCell cell31 = new PdfPCell(new Paragraph("户口性质   □ 非农业家庭户口   □ 农业家庭户口\n\n" +
//                "           □ 非农业集体户口   □ 农业集体户口", font6));
        cell31.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell31.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell31.setColspan(2);
        cell31.setFixedHeight(28);
        table2.addCell(cell31);
        document.add(table2);

        //现住地址信息表格
        PdfPTable table3 = new PdfPTable(8);
        table3.setWidthPercentage(100f);
        table3.setWidths(new int[]{3, 12, 13, 12, 18, 15, 12, 15});

        PdfPCell cell32 = new PdfPCell(new Paragraph("现\n住\n地\n址", font3));
        cell32.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell32.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell32.setRowspan(4);
        cell32.setFixedHeight(90);
        table3.addCell(cell32);

        String xzzsf = (String) params.get("xzzsf");        //现住址省份
        xzzsf = xzzsf == null ? "" : DataDict.getChineseValueByCode(EStandTables.省份城市表, xzzsf);
        String xzzqx = (String) params.get("xzzqx");        //现住址区县
        xzzqx = xzzqx == null ? "" : DataDict.getChineseValueByCode(EStandTables.区县表, xzzqx);
        String xzzjd = (String) params.get("xzzjd");        //现住址街道
        xzzjd = xzzjd == null ? "" : DataDict.getChineseValueByCode(EStandTables.街道表, xzzjd);
        String xzzjw = (String) params.get("xzzjw");        //现住址居委
        xzzjw = xzzjw == null ? "" : DataDict.getChineseValueByCode(EStandTables.居委表, xzzjw);
        String xzzrod = (String) params.get("xzzrod");      //现住址路
        xzzrod = xzzrod == null ? "" : xzzrod + "路 ";
        String xzzz = (String) params.get("xzzz");          //现住址弄/组
        xzzz = xzzz == null ? "" : xzzz + "弄/组 ";
        String xzzldh = (String) params.get("xzzldh");      //现住址楼栋号
        xzzldh = xzzldh == null ? "" : xzzldh + "楼栋号 ";
        String xzzs = (String) params.get("xzzs");          //现住址室
        xzzs = xzzs == null ? "" : xzzs + "室 ";
        String xzdz = "上海市 " + xzzqx + " " + xzzjd + " " + xzzjw + " " + xzzrod + xzzz + xzzldh + xzzs;
//        String xzdz = "上海市(省/市)  " + xzzqx + "(市/区) " + xzzjd + "(街镇) " + xzzjw + "(居委) " + xzzrod + "(路) " + xzzz + "(弄/组) " + xzzldh + "(楼栋号) " + xzzs + "(室)";
        PdfPCell cell33 = new PdfPCell(new Paragraph("居住地址：" + xzdz, font6));
        cell33.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell33.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell33.setColspan(5);
        cell33.setFixedHeight(20);
        table3.addCell(cell33);

        PdfPCell cell34 = new PdfPCell(new Paragraph("邮政编码", font6));
        cell34.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell34.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell34.setFixedHeight(20);
        table3.addCell(cell34);

        String xzzyzbm = (String) params.get("xzzyzbm");
        xzzyzbm = xzzyzbm == null ? "" : xzzyzbm;
        PdfPCell cell35 = new PdfPCell(new Paragraph(xzzyzbm, font6));
        cell35.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell35.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell35.setFixedHeight(20);
        table3.addCell(cell35);

        PdfPCell cell36 = new PdfPCell(new Paragraph("省   份", font6));
        cell36.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell36.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell36.setFixedHeight(20);
        table3.addCell(cell36);

        PdfPCell cell37 = new PdfPCell(new Paragraph("上海市", font6));
        cell37.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell37.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell37.setFixedHeight(20);
        table3.addCell(cell37);

        PdfPCell cell38 = new PdfPCell(new Paragraph("城  市", font6));
        cell38.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell38.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell38.setFixedHeight(20);
        table3.addCell(cell38);

        PdfPCell cell39 = new PdfPCell(new Paragraph("上海市", font6));
        cell39.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell39.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell39.setFixedHeight(20);
        table3.addCell(cell39);

        PdfPCell cell40 = new PdfPCell(new Paragraph("地   区", font6));
        cell40.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell40.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell40.setFixedHeight(20);
        table3.addCell(cell40);

        PdfPCell cell41 = new PdfPCell(new Paragraph(xzzqx, font6));
        cell41.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell41.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell41.setColspan(2);
        cell41.setFixedHeight(20);
        table3.addCell(cell41);

        PdfPCell cell42 = new PdfPCell(new Paragraph("街  道", font6));
        cell42.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell42.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell42.setFixedHeight(28);
        table3.addCell(cell42);

        PdfPCell cell43 = new PdfPCell(new Paragraph(xzzjd, font6));
        cell43.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell43.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell43.setFixedHeight(28);
        table3.addCell(cell43);

        PdfPCell cell44 = new PdfPCell(new Paragraph("居  委", font6));
        cell44.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell44.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell44.setFixedHeight(28);
        table3.addCell(cell44);

        PdfPCell cell45 = new PdfPCell(new Paragraph(xzzjw, font6));
        cell45.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell45.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell45.setFixedHeight(28);
        table3.addCell(cell45);

        String zfxz = (String) params.get("zfxz");
        PdfPCell cell46 = new PdfPCell(new Paragraph(getZfxzPdf(zfxz), font6));
//        PdfPCell cell46 = new PdfPCell(new Paragraph("房屋属性     □ 产权房  □ 租赁  □公/廉租房\n\n" +
//                "□集体宿舍 □其他 \n", font6));
        cell46.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell46.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell46.setColspan(3);
        cell46.setFixedHeight(28);
        table3.addCell(cell46);

        PdfPCell cell47 = new PdfPCell(new Paragraph("备注：（要求区内人户分离的，请写明居住地就读的意愿，根据实际报名情况统筹安排或者回户籍地就读。）", font5));
        cell47.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell47.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell47.setColspan(7);
        cell47.setFixedHeight(22);
        cell47.setBackgroundColor(new BaseColor(238, 236, 225));
        table3.addCell(cell47);
        document.add(table3);

        //家庭成员表格
        PdfPTable table4 = new PdfPTable(5);
        table4.setWidthPercentage(100f);
        table4.setWidths(new int[]{3, 12, 13, 32, 40});

        PdfPCell cell48 = new PdfPCell(new Paragraph("家\n\n庭\n\n成\n\n员", font3));
        cell48.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell48.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell48.setRowspan(5);
        cell48.setFixedHeight(105);
        table4.addCell(cell48);

        PdfPCell cell49 = new PdfPCell(new Paragraph("称  谓", font6));
        cell49.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell49.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell49.setFixedHeight(25);
        table4.addCell(cell49);

        PdfPCell cell50 = new PdfPCell(new Paragraph("姓  名", font6));
        cell50.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell50.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell50.setFixedHeight(25);
        table4.addCell(cell50);

        PdfPCell cell51 = new PdfPCell(new Paragraph("联系方式", font6));
        cell51.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell51.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell51.setFixedHeight(25);
        table4.addCell(cell51);

        PdfPCell cell52 = new PdfPCell(new Paragraph("工作单位名称", font6));
        cell52.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell52.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell52.setFixedHeight(25);
        table4.addCell(cell52);

        //第一行
        String jtcygx = (String) params.get("jtcygx");
        jtcygx = jtcygx == null ? "" : DataDict.getChineseValueByCode(EStandTables.家庭关系表, jtcygx);
        PdfPCell cell53 = new PdfPCell(new Paragraph(jtcygx, font6));
        cell53.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell53.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell53.setFixedHeight(20);
        table4.addCell(cell53);

        String jtcyxm = (String) params.get("jtcyxm");
        jtcyxm = jtcyxm == null ? "" : jtcyxm;
        PdfPCell cell54 = new PdfPCell(new Paragraph(jtcyxm, font6));
        cell54.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell54.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell54.setFixedHeight(20);
        table4.addCell(cell54);

        String jtcylxfs = (String) params.get("jtcylxfs");
        jtcylxfs = jtcylxfs == null ? "" : jtcylxfs;
        PdfPCell cell55 = new PdfPCell(new Paragraph(jtcylxfs, font6));
        cell55.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell55.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell55.setFixedHeight(20);
        table4.addCell(cell55);

        String jtcygzdw = (String) params.get("jtcygzdw");
        jtcygzdw = jtcygzdw == null ? "" : jtcygzdw;
        PdfPCell cell56 = new PdfPCell(new Paragraph(jtcygzdw, font6));
        cell56.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell56.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell56.setFixedHeight(20);
        table4.addCell(cell56);

        //第二行
        String jtcygx1 = (String) params.get("jtcygx1");
        jtcygx1 = jtcygx1 == null ? "" : DataDict.getChineseValueByCode(EStandTables.家庭关系表, jtcygx1);
        PdfPCell cell57 = new PdfPCell(new Paragraph(jtcygx1, font6));
        cell57.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell57.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell57.setFixedHeight(20);
        table4.addCell(cell57);

        String jtcyxm1 = (String) params.get("jtcyxm1");
        jtcyxm1 = jtcyxm1 == null ? "" : jtcyxm1;
        PdfPCell cell58 = new PdfPCell(new Paragraph(jtcyxm1, font6));
        cell58.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell58.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell58.setFixedHeight(20);
        table4.addCell(cell58);

        String jtcylxfs1 = (String) params.get("jtcylxfs1");
        jtcylxfs1 = jtcylxfs1 == null ? "" : jtcylxfs1;
        PdfPCell cell59 = new PdfPCell(new Paragraph(jtcylxfs1, font6));
        cell59.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell59.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell59.setFixedHeight(20);
        table4.addCell(cell59);

        String jtcygzdw1 = (String) params.get("jtcygzdw1");
        jtcygzdw1 = jtcygzdw1 == null ? "" : jtcygzdw1;
        PdfPCell cell60 = new PdfPCell(new Paragraph(jtcygzdw1, font6));
        cell60.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell60.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell60.setFixedHeight(20);
        table4.addCell(cell60);

        //第三行
        String jtcygx2 = (String) params.get("jtcygx2");
        jtcygx2 = jtcygx2 == null ? "" : DataDict.getChineseValueByCode(EStandTables.家庭关系表, jtcygx2);
        PdfPCell cell61 = new PdfPCell(new Paragraph(jtcygx2, font6));
        cell61.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell61.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell61.setFixedHeight(20);
        table4.addCell(cell61);

        String jtcyxm2 = (String) params.get("jtcyxm2");
        jtcyxm2 = jtcyxm2 == null ? "" : jtcyxm2;
        PdfPCell cell62 = new PdfPCell(new Paragraph(jtcyxm2, font6));
        cell62.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell62.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell62.setFixedHeight(20);
        table4.addCell(cell62);

        String jtcylxfs2 = (String) params.get("jtcylxfs2");
        jtcylxfs2 = jtcylxfs2 == null ? "" : jtcylxfs2;
        PdfPCell cell63 = new PdfPCell(new Paragraph(jtcylxfs2, font6));
        cell63.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell63.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell63.setFixedHeight(20);
        table4.addCell(cell63);

        String jtcygzdw2 = (String) params.get("jtcygzdw2");
        jtcygzdw2 = jtcygzdw2 == null ? "" : jtcygzdw2;
        PdfPCell cell64 = new PdfPCell(new Paragraph(jtcygzdw2, font6));
        cell64.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell64.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell64.setFixedHeight(20);
        table4.addCell(cell64);

        //第四行
        String jtcygx3 = (String) params.get("jtcygx3");
        jtcygx3 = jtcygx3 == null ? "" : DataDict.getChineseValueByCode(EStandTables.家庭关系表, jtcygx3);
        PdfPCell cell65 = new PdfPCell(new Paragraph(jtcygx3, font6));
        cell65.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell65.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell65.setFixedHeight(20);
        table4.addCell(cell65);

        String jtcyxm3 = (String) params.get("jtcyxm3");
        jtcyxm3 = jtcyxm3 == null ? "" : jtcyxm3;
        PdfPCell cell66 = new PdfPCell(new Paragraph(jtcyxm3, font6));
        cell66.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell66.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell66.setFixedHeight(20);
        table4.addCell(cell66);

        String jtcylxfs3 = (String) params.get("jtcylxfs3");
        jtcylxfs3 = jtcylxfs3 == null ? "" : jtcylxfs3;
        PdfPCell cell67 = new PdfPCell(new Paragraph(jtcylxfs3, font6));
        cell67.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell67.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell67.setFixedHeight(20);
        table4.addCell(cell67);

        String jtcygzdw3 = (String) params.get("jtcygzdw3");
        jtcygzdw3 = jtcygzdw3 == null ? "" : jtcygzdw3;
        PdfPCell cell68 = new PdfPCell(new Paragraph(jtcygzdw3, font6));
        cell68.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell68.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell68.setFixedHeight(20);
        table4.addCell(cell68);

        //第五行

        PdfPCell cell69 = new PdfPCell(new Paragraph("监护人姓名", font6));
        cell69.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell69.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell69.setColspan(2);
        cell69.setFixedHeight(20);
        table4.addCell(cell69);

        String jhrxm = (String) params.get("jhrxm");
        jhrxm = jhrxm == null ? "" : jhrxm;
        PdfPCell cell70 = new PdfPCell(new Paragraph(jhrxm, font6));
        cell70.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell70.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell70.setFixedHeight(20);
        table4.addCell(cell70);

        PdfPCell cell71 = new PdfPCell(new Paragraph("监护人与幼儿关系", font6));
        cell71.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell71.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell71.setFixedHeight(20);
        table4.addCell(cell71);

        String jhrgx = (String) params.get("jhrgx");
        jhrgx = jhrgx == null ? "" : DataDict.getChineseValueByCode(EStandTables.家庭关系表, jhrgx);
        PdfPCell cell72 = new PdfPCell(new Paragraph(jhrgx, font6));
        cell72.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell72.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell72.setFixedHeight(20);
        table4.addCell(cell72);

        PdfPCell cell73 = new PdfPCell(new Paragraph("以下部分由教师填写（教师核对证件后打钩）", font3));
        cell73.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell73.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell73.setColspan(5);
        cell73.setFixedHeight(20);
        table4.addCell(cell73);
        document.add(table4);

        //户籍类型表格
        PdfPTable table5 = new PdfPTable(4);
        table5.setWidthPercentage(100f);
        table5.setWidths(new int[]{3, 23, 30, 44});

        PdfPCell cell74 = new PdfPCell(new Paragraph("户籍类型", font3));
        cell74.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell74.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell74.setRowspan(5);
        cell74.setFixedHeight(116);
        table5.addCell(cell74);

        //第一行
        PdfPCell cell75 = new PdfPCell(new Paragraph("本区户籍", font6));
        cell75.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell75.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell75.setFixedHeight(28);
        table5.addCell(cell75);

        String ryyjlb = (String) params.get("ryyjlb");
        ryyjlb = ryyjlb == null ? "" : ryyjlb;
        PdfPCell cell76 = new PdfPCell(new Paragraph(getRyyjlbPdf("101", ryyjlb), font6));
//        PdfPCell cell76 = new PdfPCell(new Paragraph("□人户一致  □人户分离  □公共户口  □集体户口  持产证人与幼儿关系： ", font6));
        cell76.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell76.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell76.setFixedHeight(28);
        table5.addCell(cell76);

        String gfrgx = (String) params.get("gfrgx");
        PdfPCell cell76_1 = new PdfPCell(new Paragraph(getHzgxPdf(gfrgx), font6));
//        PdfPCell cell76_1 = new PdfPCell(new Paragraph("持产证人与幼儿关系： □本人或父母  \n\n" +
//                "□祖父母/外祖父母   □兄弟姐妹 □其他亲属  □非亲属", font6));
        cell76_1.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell76_1.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell76_1.setFixedHeight(28);
        table5.addCell(cell76_1);

        //第二行
        PdfPCell cell77 = new PdfPCell(new Paragraph("外区户籍", font6));
        cell77.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell77.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell77.setFixedHeight(20);
        table5.addCell(cell77);

        PdfPCell cell78 = new PdfPCell(new Paragraph(getRyyjlbPdf("102", ryyjlb), font6));
//        PdfPCell cell78 = new PdfPCell(new Paragraph("□父母一方持有区房产证明   □居住地申请回执", font6));
        cell78.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell78.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell78.setColspan(2);
        cell78.setFixedHeight(20);
        table5.addCell(cell78);

        //第三行
        PdfPCell cell79 = new PdfPCell(new Paragraph("外 省 市", font6));
        cell79.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell79.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell79.setFixedHeight(28);
        table5.addCell(cell79);

        PdfPCell cell80 = new PdfPCell(new Paragraph(getRyyjlbPdf("103", ryyjlb), font6));
//        PdfPCell cell80 = new PdfPCell(new Paragraph("□父母一方《上海居住证》   □父母一方积分达到标准分值\n\n" +
//                "□房屋产证（产权为父母一方或本人）", font6));
        cell80.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell80.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell80.setColspan(2);
        cell80.setFixedHeight(28);
        table5.addCell(cell80);

        //第四行
        PdfPCell cell81 = new PdfPCell(new Paragraph("港 澳 台", font6));
        cell81.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell81.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell81.setFixedHeight(20);
        table5.addCell(cell81);

        PdfPCell cell82 = new PdfPCell(new Paragraph(getRyyjlbPdf("104", ryyjlb), font6));
//        PdfPCell cell82 = new PdfPCell(new Paragraph("□幼儿身份证明          □住房证明    □法定监护人委托书", font6));
        cell82.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell82.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell82.setColspan(2);
        cell82.setFixedHeight(20);
        table5.addCell(cell82);

        //第五行
        PdfPCell cell85 = new PdfPCell(new Paragraph("外    籍", font6));
        cell85.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
        cell85.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell85.setFixedHeight(20);
        table5.addCell(cell85);

        PdfPCell cell86 = new PdfPCell(new Paragraph(getRyyjlbPdf("105", ryyjlb), font6));
//        PdfPCell cell86 = new PdfPCell(new Paragraph("□幼儿身份证明          □住房证明    □法定监护人材料证明     国籍： ", font6));
        cell86.setHorizontalAlignment(Element.ALIGN_LEFT); //水平对其方式
        cell86.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
        cell86.setColspan(2);
        cell86.setFixedHeight(20);
        table5.addCell(cell86);
        document.add(table5);

        //审核意见
//        PdfPTable table6 = new PdfPTable(2);
//        table6.setWidthPercentage(100f);
//        table6.setWidths(new int[]{20, 80});
//
//        PdfPCell cell87 = new PdfPCell(new Paragraph("审核意见", font3));
//        cell87.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
//        cell87.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
//        cell87.setFixedHeight(30);
//        table6.addCell(cell87);
//
//        PdfPCell cell88 = new PdfPCell(new Paragraph("", font3));
//        cell88.setHorizontalAlignment(Element.ALIGN_CENTER); //水平对其方式
//        cell88.setVerticalAlignment(Element.ALIGN_MIDDLE); //垂直对其方式
//        cell88.setFixedHeight(30);
//        table6.addCell(cell88);
    }

    private String getSfzlxPdf(String sfzlx) {
        if ("D".equals(sfzlx)) return "  □居民身份证 √港澳居民来往内地通行证 \n\n" +
                "   □台湾居民来往大陆通行证  □境外  □护照 ";
        if ("1".equals(sfzlx)) return "  √居民身份证 □港澳居民来往内地通行证 \n\n" +
                "   □台湾居民来往大陆通行证  □境外  □护照 ";
        if ("8".equals(sfzlx)) return "  □居民身份证 □港澳居民来往内地通行证 \n\n" +
                "   √台湾居民来往大陆通行证  □境外  □护照 ";
        if ("9".equals(sfzlx)) return "  □居民身份证 □港澳居民来往内地通行证 \n\n" +
                "   □台湾居民来往大陆通行证  √境外  □护照 ";
        if ("A".equals(sfzlx)) return "  □居民身份证 □港澳居民来往内地通行证 \n\n" +
                "   □台湾居民来往大陆通行证  □境外  √护照 ";
        return "    □居民身份证 □港澳居民来往内地通行证 \n\n" +
                "   □台湾居民来往大陆通行证  □境外  □护照 ";
    }

    private String getSfdszvPdf(String sfdszv) {
        if ("0".equals(sfdszv)) return "√ 独生子女 □ 双胞胎 □ 两胎及以上";
        if ("1".equals(sfdszv)) return "□ 独生子女 √ 双胞胎 □ 两胎及以上";
        if ("2".equals(sfdszv)) return "□ 独生子女 □ 双胞胎 √ 两胎及以上";
        return "□ 独生子女 □ 双胞胎 □ 两胎及以上";
    }

    private String getJkzkPdf(String jkzk) {
        if ("10".equals(jkzk)) return "   √健康或良好  □一般或较弱 \n\n" +
                "   □有慢性病    □残疾";
        if ("20".equals(jkzk)) return "   □健康或良好  √一般或较弱 \n\n" +
                "   □有慢性病    □残疾";
        if ("30".equals(jkzk)) return "   □健康或良好  □一般或较弱 \n\n" +
                "   √有慢性病    □残疾";
        if ("60".equals(jkzk)) return "   □健康或良好  □一般或较弱 \n\n" +
                "   □有慢性病    √残疾";
        return "   □健康或良好  □一般或较弱 \n\n" +
                "   □有慢性病    □残疾";
    }

    private String getHkxzPdf(String hkxz) {
        if ("1".equals(hkxz)) return "户口性质   √ 非农业家庭户口   □ 农业家庭户口\n\n" +
                "           □ 非农业集体户口   □ 农业集体户口";
        if ("2".equals(hkxz)) return "户口性质   □ 非农业家庭户口   √ 农业家庭户口\n\n" +
                "           □ 非农业集体户口   □ 农业集体户口";
        if ("3".equals(hkxz)) return "户口性质   □ 非农业家庭户口   □ 农业家庭户口\n\n" +
                "           √ 非农业集体户口   □ 农业集体户口";
        if ("4".equals(hkxz)) return "户口性质   □ 非农业家庭户口   □ 农业家庭户口\n\n" +
                "           □ 非农业集体户口   √ 农业集体户口";
        return "户口性质   □ 非农业家庭户口   □ 农业家庭户口\n\n" +
                "           □ 非农业集体户口   □ 农业集体户口";
    }

    private String getZfxzPdf(String zfxz) {
        if ("1".equals(zfxz)) return "房屋属性     □ 产权房  □ 租赁  √公/廉租房\n\n" +
                "□集体宿舍 □其他";
        if ("2".equals(zfxz)) return "房屋属性     □ 产权房  □ 租赁  □公/廉租房\n\n" +
                "√集体宿舍 □其他";
        if ("3".equals(zfxz)) return "房屋属性     □ 产权房  √租赁  □公/廉租房\n\n" +
                "□集体宿舍 □其他";
        if ("4".equals(zfxz)) return "房屋属性     √ 产权房  □ 租赁  □公/廉租房\n\n" +
                "□集体宿舍 □其他";
        if ("5".equals(zfxz)) return "房屋属性     □ 产权房  □ 租赁  □公/廉租房\n\n" +
                "□集体宿舍 √其他";
        return "房屋属性     □ 产权房  □ 租赁  □公/廉租房\n\n" +
                "□集体宿舍 □其他";
    }

    private String getRyyjlbPdf(String ryyj, String ryyjlb) {
        if ("101".equals(ryyj)) {
            if ("1010".equals(ryyjlb)) return "√人户一致  □人户分离  \n\n" +
                    "□公共户口  □集体户口";
            if ("1011".equals(ryyjlb)) return "□人户一致  √人户分离  \n\n" +
                    "□公共户口  □集体户口";
            if ("1012".equals(ryyjlb)) return "□人户一致  □人户分离  \n\n" +
                    "√公共户口  □集体户口";
            if ("1013".equals(ryyjlb)) return "□人户一致  □人户分离  \n\n" +
                    "□公共户口  √集体户口";
            return "□人户一致  □人户分离  \n\n" +
                    "□公共户口  □集体户口";
        }
        if ("102".equals(ryyj)) {
            if ("1020".equals(ryyjlb)) return "√父母一方持有区房产证明   □居住地申请回执";
            if ("1021".equals(ryyjlb)) return "□父母一方持有区房产证明   √居住地申请回执";
            return "□父母一方持有区房产证明   □居住地申请回执";
        }
        if ("103".equals(ryyj)) {
            if ("1030".equals(ryyjlb)) return "√父母一方《上海居住证》   □父母一方积分达到标准分值\n\n" +
                    "□房屋产证（产权为父母一方或本人）";
            if ("1031".equals(ryyjlb)) return "□父母一方《上海居住证》   √父母一方积分达到标准分值\n\n" +
                    "□房屋产证（产权为父母一方或本人）";
            if ("1032".equals(ryyjlb)) return "□父母一方《上海居住证》   □父母一方积分达到标准分值\n\n" +
                    "√房屋产证（产权为父母一方或本人）";
            return "□父母一方《上海居住证》   □父母一方积分达到标准分值\n\n" +
                    "□房屋产证（产权为父母一方或本人）";
        }
        if ("104".equals(ryyj)) {
            if ("1040".equals(ryyjlb)) return "√幼儿身份证明             □住房证明    □法定监护人委托书";
            if ("1041".equals(ryyjlb)) return "□幼儿身份证明             √住房证明    □法定监护人委托书";
            if ("1042".equals(ryyjlb)) return "□幼儿身份证明             □住房证明    √法定监护人委托书";
            return "□幼儿身份证明             □住房证明    □法定监护人委托书";
        }
        if ("105".equals(ryyj)) {
            if ("1050".equals(ryyjlb)) return "√幼儿身份证明             □住房证明    □法定监护人材料证明  ";
            if ("1051".equals(ryyjlb)) return "□幼儿身份证明             √住房证明    □法定监护人材料证明  ";
            if ("1052".equals(ryyjlb)) return "□幼儿身份证明             □住房证明    √法定监护人材料证明  ";
            return "□幼儿身份证明             □住房证明    □法定监护人材料证明  ";
        }
        return "";
    }

    private String getHzgxPdf(String hzgx) {
        if ("1".equals(hzgx) || "2".equals(hzgx)) return "持产证人与幼儿关系： √本人或父母  \n\n" +
                "□祖父母/外祖父母   □兄弟姐妹 □其他亲属  □非亲属";
        if ("3".equals(hzgx)) return "持产证人与幼儿关系： □本人或父母  \n\n" +
                "√祖父母/外祖父母   □兄弟姐妹 □其他亲属  □非亲属";
        if ("4".equals(hzgx)) return "持产证人与幼儿关系： □本人或父母  \n\n" +
                "□祖父母/外祖父母   √兄弟姐妹 □其他亲属  □非亲属";
        if ("5".equals(hzgx)) return "持产证人与幼儿关系： □本人或父母  \n\n" +
                "□祖父母/外祖父母   □兄弟姐妹 √其他亲属  □非亲属";
        if ("6".equals(hzgx)) return "持产证人与幼儿关系： □本人或父母  \n\n" +
                "□祖父母/外祖父母   □兄弟姐妹 □其他亲属  √非亲属";
        return "持产证人与幼儿关系： □本人或父母  \n\n" +
                "□祖父母/外祖父母   □兄弟姐妹 □其他亲属  □非亲属";
    }
}
